package com.nCoV.EpidemicSurveillance.repository;

import java.util.List;

import org.springframework.data.neo4j.annotation.Query;
import org.springframework.data.neo4j.repository.Neo4jRepository;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Component;

import com.nCoV.EpidemicSurveillance.domain.StudentNodes;
import com.nCoV.EpidemicSurveillance.domain.StudentPlaceRelationship;

/**
 * @author 张浩田
 * @date 2020年3月14日
 */
@Component
public interface StuPlaRelsRespository extends Neo4jRepository<StudentPlaceRelationship, Long> {

	@Query("match (from)-[r]-(to) where ID(from)=:#{#studentNodes.id} " 
			+ "return r,startnode(r),endnode(r)")
	List<StudentPlaceRelationship> getEdges(@Param("studentNodes") StudentNodes studentNodes);

}
